package com.xxx.file;

import java.io.*;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/22  15:34
 * @Copyright
 */
public class BufferedInputStreamDome {
    public static void main(String[] args) {
        try (
                BufferedInputStream inputStream = new BufferedInputStream( new FileInputStream("a.txt"));
                BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream("a1.txt"));
        ) {
            byte[] b = new byte[1024];
            int read = 0;
            while ((read = inputStream.read(b)) != -1) {
                System.out.println(new String(b, 0, read));
                bufferedOutputStream.write(b, 0, read);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
